import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int[] a1=new int[2];
        int[] a2=new int[2];
        int[] b1=new int[2];
        int[] b2=new int[2];
        int[][] ints={a1,a2,b1,b2};
        for(int[] x:ints){
            x[0]=scanner.nextInt();
            x[1]=scanner.nextInt();
        }
        int s1=(Math.abs(a2[0]-a1[0])*Math.abs(a2[1]-a1[1]));
        int s2=(Math.abs(b2[0]-b1[0])*Math.abs(b2[1]-b1[1]));
        int sMax=s1>=s2?s1:s2;
        int s=0;
        ArrayList<int[]>  max=new ArrayList<>();
        ArrayList<int[]>  min=new ArrayList<>();
        if(s1>=s2){
            max.add(a1);
            max.add(a2);
            min.add(b1);
            min.add(b2);
        }
        else {
            max.add(b1);
            max.add(b2);
            min.add(a1);
            min.add(a2);
        }
        boolean det1=(min.get(0)[0]>=max.get(0)[0]&&min.get(0)[1]>=max.get(0)[1])&&(min.get(0)[0]<=max.get(1)[0]&&min.get(0)[1]<=max.get(1)[1]);
        boolean det2=(min.get(1)[0]>=max.get(0)[0]&&min.get(1)[1]>=max.get(0)[1])&&(min.get(1)[0]<=max.get(1)[0]&&min.get(1)[1]<=max.get(1)[1]);
        boolean det3=(min.get(0)[0]>=max.get(0)[0]&&min.get(1)[1]<=max.get(1)[1])&&(min.get(0)[0]<=max.get(1)[0]&&min.get(1)[1]>=max.get(0)[1]);
        boolean det4=(min.get(1)[0]>=max.get(0)[0]&&min.get(0)[1]<=max.get(1)[1])&&(min.get(1)[0]<=max.get(1)[0]&&min.get(0)[1]>=max.get(0)[1]);
        if(det1&&det2){
            s=sMax;
        }
        if(det1||det2||det3||det4){
            int[] p1=new int[2];
            int[] p2=new int[2];
            p1[0]=min.get(0)[0]>=max.get(0)[0]?min.get(0)[0]:max.get(0)[0];
            p1[1]=min.get(0)[1]>=max.get(0)[1]?min.get(0)[1]:max.get(0)[1];
            p2[0]=min.get(1)[0]<=max.get(1)[0]?min.get(1)[0]:max.get(1)[0];
            p2[1]=min.get(1)[1]<=max.get(1)[1]?min.get(1)[1]:max.get(1)[1];
            s=s1+s2-(Math.abs(p2[0]-p1[0])*Math.abs(p2[1]-p1[1]));
        }
        System.out.println(s);
    }
}
